package com.hancai.barrage.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hancai.barrage.utils.Constant;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Getter
@Setter
public class Client {
    //设置用户默认状态和是否注销默认值
    public static final String STATUS_NORMAL="0";
    public static final boolean NO_DELETED=false;
    private Long id;

    private String username;

    private String password;

    private String avatar;

    private String nickname;

    private Integer gender;

    private String signature;

    private String status;

    private Boolean deleted;//账号是否已经被删除
    //@JsonFormat(后端序列化到前端)
    @JsonFormat(pattern = Constant.DEFAULT_FORMAT_DATETIME_PATTERN,timezone = Constant.DEFAULT_FORMAT_DATETIME_TIMEZONE)
    //@DateTimeFormat(前端到后端)
    @DateTimeFormat(pattern=Constant.DEFAULT_FORMAT_DATETIME_PATTERN)
    private Date ctime;//客户账号创建时间

    //@JsonFormat(后端序列化到前端)
    @JsonFormat(pattern = Constant.DEFAULT_FORMAT_DATETIME_PATTERN,timezone = Constant.DEFAULT_FORMAT_DATETIME_TIMEZONE)
    //@DateTimeFormat(前端到后端)
    @DateTimeFormat(pattern=Constant.DEFAULT_FORMAT_DATETIME_PATTERN)
    private Date utime;//客户账号更新时间


}